import 'ant-design-vue/dist/reset.css';
import 'element-plus/dist/index.css'
import 'virtual:svg-icons-register';
import '@/assets/styles/index.scss';

import { createApp } from 'vue';
import { Dropdown, Menu, MenuItem } from 'ant-design-vue';
import App from './App.vue';
import ElementPlus from 'element-plus';
import router from './router';
import directives from './directives';
import errorCatcher from './plugins/errorCapture';
import createI18n from './plugins/createI18n';
import zh from '@/assets/i18n/zh.json';
import en from '@/assets/i18n/en.json';
import resolver from './utils/resolve.js';
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const i18n = createI18n({ lang: 'zh', fallback: 'en', map: { zh, en } });

const app = createApp(App);
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
	// console.log("key:", key, ",component:", component)
	app.component(key, component)
}
app.use(router) // 路由
	.use(directives) // 指令
	.use(i18n) // 国际化
	.use(errorCatcher) // 错误处理
	.use(ElementPlus)
	.use(Dropdown)
	.use(Menu)
	.use(resolver)
	.mount('#app');
